Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not restarting if a task exited properly #491

Merged
merged 5 commits into from
Nov 23, 2015
Merged

Conversation

diptanu
Copy link
Contributor

@diptanu diptanu commented Nov 23, 2015

Nomad shouldn't restart tasks which exit with 0 for jobs which are dispatched via the batch scheduler.

func (b *batchRestartTracker) nextRestart() (bool, time.Duration) {
if b.count < b.maxAttempts {
func (b *batchRestartTracker) nextRestart(exitCode int) (bool, time.Duration) {
if (b.count < b.maxAttempts) && (exitCode > 0) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Get rid of the parenthesis. Not very idiomatic go.

@dadgar
Copy link
Contributor

dadgar commented Nov 23, 2015

LGTM. Please update changelog as well

diptanu added a commit that referenced this pull request Nov 23, 2015
Not restarting if a task exited properly
@diptanu diptanu merged commit 2fccadc into master Nov 23, 2015
@diptanu diptanu deleted the b-batch-task-restart branch November 23, 2015 19:17
benbuzbee pushed a commit to benbuzbee/nomad that referenced this pull request Jul 21, 2022
@github-actions
Copy link

github-actions bot commented May 2, 2023

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants